#define _CRT_SECURE_NO_WARNINGS

#include"conent.h"

Stack* createStack(void)
{
	Stack* pStack= (Stack*)malloc(sizeof(Stack));
	if (NULL == pStack)
	{
		perror("pStack error");
		return NULL;
	}
	memset(pStack, 0, sizeof(Stack));
	return pStack;
}
int InStack(Stack* pStack, data_type item)
{
	if (NULL == pStack)
	{
		return STACKNULL;
	}
	if (pStack->top == N - 1)
	{
		return FULL;
	}
	pStack->top++;
	pStack->arr[pStack->top] = item;
	return OK;
}
int OutStack(Stack* pStack, data_type* pData)
{
	if (NULL == pStack)
	{
		return STACKNULL;
	}
	if (pStack->top == -1)
	{
		return EMPTY;
	}
	*pData = pStack->arr[pStack->top];
	pStack->top--;
	return OK;
}